package com.flyee.service
{
	import com.flyee.communicate.AbstractHandler;
	import com.flyee.communicate.Communicate;
	import com.flyee.controller.tools.cartoon.model.As3Cartoon;
	import com.flyee.controller.tools.cartoon.model.CartoonData;
	import com.flyee.io.webservice.RemoteBean;
	import com.flyee.io.webservice.RemoteService;

	public class CartoonFlexService extends AbstractHandler implements Communicate
	{
		public function CartoonFlexService()
		{
			super(null)
		}
		/**
     	* 保存CartoonData列表
     	* @param cartoonDatas
     	*/
		public function saveCartoonDataList(cartoonDatas:Array,returnFun:Function):void
		{
			this.callbackFn = returnFun;
			var tempRe:RemoteBean = RemoteService.getInstance().getRemoteBean("cartoonFlexService",this);
			tempRe.saveCartoonDataList(cartoonDatas);
			
		}
		public function saveCartoonData(cartoonData:CartoonData,returnFun:Function):void
		{
			this.callbackFn = returnFun;
			var tempRe:RemoteBean = RemoteService.getInstance().getRemoteBean("cartoonFlexService",this);
			tempRe.saveCartoonData(cartoonData);
		}
		public function saveCartoon(cartoon:As3Cartoon,returnFun:Function):void
		{
			this.callbackFn = returnFun;
			var tempRe:RemoteBean = RemoteService.getInstance().getRemoteBean("cartoonFlexService",this);
			tempRe.saveCartoon(cartoon);
		}
		public function getCartoonByUser(userID:String,returnFun:Function):void
		{
			this.callbackFn = returnFun;
			var tempRe:RemoteBean = RemoteService.getInstance().getRemoteBean("cartoonFlexService",this);
			tempRe.getCartoonByUser(userID);
		}
		public function saveUserCartoon(cartoonId:String,userID:String,returnFun:Function):void
		{
			this.callbackFn = returnFun;
			var tempRe:RemoteBean = RemoteService.getInstance().getRemoteBean("cartoonFlexService",this);
			tempRe.saveUserCartoon(cartoonId,userID);
		}
		/**
		 * 获取人物装备信息
		 * @param cartoonID
		 * @param returnFun
		 * 
		 */		
		public function listByCartoonId(cartoonID:String,returnFun:Function):void
		{
			this.callbackFn = returnFun;
			var tempRe:RemoteBean = RemoteService.getInstance().getRemoteBean("cartoonFlexService",this);
			tempRe.listByCartoonId(cartoonID);
		}
		public function getCartoon(cartoonID:String,returnFun:Function):void
		{
			this.callbackFn = returnFun;
			var tempRe:RemoteBean = RemoteService.getInstance().getRemoteBean("cartoonFlexService",this);
			tempRe.getCartoon(cartoonID);
		}
		public function updateCartoon(cartoon:As3Cartoon,returnFun:Function):void
		{
			this.callbackFn = returnFun;
			var tempRe:RemoteBean = RemoteService.getInstance().getRemoteBean("cartoonFlexService",this);
			tempRe.updateCartoon(cartoon);
		}
		public function request(...args):void
		{
		}
		
		public function response(...args):void
		{
			this.callbackFn(args[0]);
		}
	}
}